{	V Open School Programming Olympiad
	Problem B
	Points: 100
}

var count,i,j,a,b,c,d:integer;
begin
assign(input,'percent.in');
assign(output,'percent.out');
reset(input);
rewrite(output);
readln(a,b,c,d);
i:=0;
count:=0;
while (i<100) and (count=0) do begin
  inc(i);
  if (trunc((a*i)/100)*100=a*i) and (trunc((b*i)/100)*100=b*i) and (trunc((c*i)/100)*100=c*i) and (trunc((d*i)/100)*100=d*i) then count:=i;
end;
writeln(count);
close(input);
close(output);
end.
 